//
//  ViewController.swift
//  HZJTextView
//
//  Created by HZJ on 17/1/10.
//  Copyright © 2017年 HZJ. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        view.backgroundColor = UIColor.white
        let lab = UILabel()
        lab.text = "TOUCH"
        lab.textColor = UIColor.randomColor()
        lab.font = UIFont.systemFont(ofSize: 22, weight: UIFont.Weight(rawValue: 1))
        view.addSubview(lab)
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
        if !hasTouch {
            hasTouch = !hasTouch
            let vc = HZJViewController()
            self.navigationController?.pushViewController(vc, animated: true)
        }
    }
    override func viewDidDisappear(_ animated: Bool) {
        super.viewDidDisappear(animated)
        self.hasTouch = false
    }
    fileprivate var hasTouch:Bool = false
}

